@echo off
:: 设置NDK路径
set NDK_PATH=D:\NDK\android-ndk-r25c

:: 切换到当前 .bat 文件所在目录
cd /d "%~dp0"

:: 判断是否已经重启
if "%1" neq "keep_open" (
    :: 重新启动自身并保持窗口打开
    start "" cmd /k "%~f0 keep_open"
    exit
)

:: 执行 ndk-build.cmd 进行编译
"%NDK_PATH%\ndk-build.cmd"

:: 显示完成信息，保持窗口打开
echo.
echo Build process completed. CMD window will remain open.
cmd /k
